home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / dev / gui / gtlayout.lha / Source / LTP_SearchKeys.c < prev    next >
C/C++ Source or Header  |  1999-01-02  |  998b  |  58 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1999 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16. #ifdef DO_PICKSHORTCUTS    /* Support code */
  17.  
  18. VOID
  19. LTP_SearchKeys(LayoutHandle *handle,ObjectNode *group)
  20. {
  21.     ObjectNode    *node;
  22.     ULONG         page;
  23.  
  24.     SCANPAGE(group,node,page)
  25.     {
  26.         if(node->Type == GROUP_KIND)
  27.             LTP_SearchKeys(handle,node);
  28.         else
  29.         {
  30.             if(node->Key)
  31.             {
  32.                 LONG i;
  33.  
  34.                 for(i = 0 ; i < 256 ; i++)
  35.                 {
  36.                     if(LTP_Keys[0][i] == node->Key || LTP_Keys[1][i] == node->Key)
  37.                     {
  38.                         handle->Keys[LTP_Keys[0][i]] = TRUE;
  39.                         handle->Keys[LTP_Keys[1][i]] = TRUE;
  40.  
  41.                         break;
  42.                     }
  43.                 }
  44.  
  45.                 if(LTP_Keys[1][node->Key])
  46.                     node->Key = LTP_Keys[0][node->Key];
  47.             }
  48.             else
  49.             {
  50.                 if((handle->CursorKey == node) || (handle->ReturnKey == node) || (handle->EscKey == node) || (handle->TabKey == node))
  51.                     node->NoKey = TRUE;
  52.             }
  53.         }
  54.     }
  55. }
  56.  
  57. #endif    /* DO_PICKSHORTCUTS */
  58.